﻿// <copyright file="IUserProvider.cs" company="Ecole Normale Supérieure">
// Released under GPLv2
// </copyright>
// <summary>Contains the user provider interface</summary>

namespace Sqwarea.Persistence
{
    using System.Collections.Generic;

    /// <summary>
    /// Contains the user provider interface
    /// </summary>
    public interface IUserProvider
    {
        /// <summary>
        /// returns the user, given its OpenId.
        /// </summary>
        /// <param name="openId">The openId you want the user</param>
        /// <returns>The user you gave the openid.</returns>
        User GetUserByOpenId(string openId);

        /// <summary>
        /// Returns a list of users of the given openIds
        /// </summary>
        /// <param name="openIds">The list of openId</param>
        /// <returns>The list of users</returns>
        IEnumerable<User> GetUsersByOpenId(IEnumerable<string> openIds);

        /// <summary>
        /// returns whether or not the user exists
        /// </summary>
        /// <param name="openId">The openId</param>
        /// <returns>Whether or not the user exists</returns>
        bool UserExists(string openId);

        /// <summary>
        /// Delete a user.
        /// </summary>
        /// <param name="user">The user to delete</param>
        void DeleteUser(User user);

        /// <summary>
        /// Saves the user on the cloud.
        /// </summary>
        /// <param name="user">The user you want to update parameters.</param>
        void UpdateUser(User user);
    }
}
